package org.jeecg.modules.demo.crm.mapper;

import java.math.BigDecimal;
import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.demo.crm.entity.CPaymentRecord;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
 * @Description: 收款记录
 * @Author: jeecg-boot
 * @Date:   2025-06-20
 * @Version: V1.0
 */
public interface CPaymentRecordMapper extends BaseMapper<CPaymentRecord> {


    @Select(" select  IFNULL(sum(payment_amount),0)  from c_payment_record where project_id = #{projectId}")
    BigDecimal getTotalAmount(@Param("projectId") String projectId);

    @Select(" select  *  from c_payment_record  WHERE invoice_apply_id LIKE CONCAT('%', #{invoiceApplyId}, '%')")
    List<CPaymentRecord> findByInvoiceApplyId(@Param("invoiceApplyId") String invoiceApplyId);


}
